package com.test.antlr4.command;

import com.test.antlr4.hello.core.HelloParser;
import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.TerminalNode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @className: Main
 * @Description:
 * @Author: wangyifei
 * @Date: 2025/5/21 15:31
 */
public class Main {
    private static Logger logger = LoggerFactory.getLogger(Main.class);

    public static void main(String[] args) {
        String expr = "ll -in in ";
        CommandLexer lexer = new CommandLexer(CharStreams.fromString(expr));
        CommonTokenStream tokens = new CommonTokenStream(lexer);
        CommandParser parser = new CommandParser(tokens);
        CommandParser.CmdContext cmd = parser.cmd();
        System.out.println(cmd.cmdPart.getText());
        System.out.println(cmd.opPart.getText());
        System.out.println(cmd.argsPart.getText());

    }
}
